package com.jianganming.facade;

//外观模式(门面模式)
public class FacadeTest {
    public static void main(String[] args) {
        new Facade().method();
    }
}

class Facade{
    private SubSystem1 subSystem1;
    private SubSystem2 subSystem2;

    public Facade(){
        subSystem1 = new SubSystem1();
        subSystem2 = new SubSystem2();
    }

    public void method(){
        subSystem1.method();
        subSystem2.method();
    }
}

class SubSystem1{
    public void method(){
        System.out.println("方法1");
    }
}

class SubSystem2{
    public void method(){
        System.out.println("方法2");
    }
}
